/*
 Navicat Premium Data Transfer

 Source Server         : localhost_root_123123
 Source Server Type    : MySQL
 Source Server Version : 50731
 Source Host           : 127.0.0.1:3306
 Source Schema         : test

 Target Server Type    : MySQL
 Target Server Version : 50731
 File Encoding         : 65001

 Date: 11/05/2023 21:38:26
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for competition
-- ----------------------------
DROP TABLE IF EXISTS `competition`;
CREATE TABLE `competition` (
  `stu_id` int(11) NOT NULL,
  `name_of_cpt` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL,
  `grade_of_cpt` tinyint(4) DEFAULT NULL,
  `granting_unit` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL,
  KEY `stu_id` (`stu_id`),
  CONSTRAINT `competition_ibfk_1` FOREIGN KEY (`stu_id`) REFERENCES `student` (`stu_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Records of competition
-- ----------------------------
BEGIN;
INSERT INTO `competition` VALUES (21210000, '2021年全国大学生数学建模大赛', 1, '全国大学生数学建模竞赛组委会');
INSERT INTO `competition` VALUES (21210001, '2021年全国大学生数学建模大赛', 1, '全国大学生数学建模竞赛组委会');
INSERT INTO `competition` VALUES (21210000, '2021年CCF编程竞赛', 2, '全国计算机协会');
INSERT INTO `competition` VALUES (21210001, '2021年ACM编程大赛', 1, '中国CCF计算机协会');
COMMIT;

-- ----------------------------
-- Table structure for scholarship
-- ----------------------------
DROP TABLE IF EXISTS `scholarship`;
CREATE TABLE `scholarship` (
  `stu_id` int(11) NOT NULL,
  `name_of_ssh` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL,
  `grade_of_ssh` tinyint(4) DEFAULT NULL,
  `amount_of_ssh` int(11) DEFAULT NULL,
  `award_time` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL,
  KEY `stu_id` (`stu_id`),
  CONSTRAINT `scholarship_ibfk_1` FOREIGN KEY (`stu_id`) REFERENCES `student` (`stu_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Records of scholarship
-- ----------------------------
BEGIN;
INSERT INTO `scholarship` VALUES (21210000, '2021国家级一等奖学金', NULL, 8000, '2021-05-11');
INSERT INTO `scholarship` VALUES (21210000, '2021年校级二等奖学金', 2, 6000, '2021-05-11');
INSERT INTO `scholarship` VALUES (21210001, '2021年院级乙等奖学金', 1, 3000, '2021-05-11');
COMMIT;

-- ----------------------------
-- Table structure for stu_course
-- ----------------------------
DROP TABLE IF EXISTS `stu_course`;
CREATE TABLE `stu_course` (
  `stu_id` int(11) NOT NULL,
  `c_name` varchar(10) COLLATE utf8mb4_bin DEFAULT NULL,
  `credit` int(11) DEFAULT NULL,
  `grade` float DEFAULT NULL,
  `gp` float DEFAULT NULL,
  `retake` tinyint(4) DEFAULT NULL,
  KEY `stu_id` (`stu_id`),
  CONSTRAINT `stu_course_ibfk_1` FOREIGN KEY (`stu_id`) REFERENCES `student` (`stu_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Records of stu_course
-- ----------------------------
BEGIN;
INSERT INTO `stu_course` VALUES (21210000, '高数', 3, 90, 2, 1);
INSERT INTO `stu_course` VALUES (21210001, '高数', 3, 45, 2, 0);
INSERT INTO `stu_course` VALUES (21210000, 'Java面向对象', 4, 89, 2, 1);
INSERT INTO `stu_course` VALUES (21210004, '数据库概论', 4, 67, 2, 1);
INSERT INTO `stu_course` VALUES (21210000, '数据库概论', 4, 92, 2, 1);
INSERT INTO `stu_course` VALUES (21210000, 'web开发技术', 2, 87, 2, 1);
COMMIT;

-- ----------------------------
-- Table structure for student
-- ----------------------------
DROP TABLE IF EXISTS `student`;
CREATE TABLE `student` (
  `stu_id` int(11) NOT NULL,
  `name` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL,
  `sex` tinyint(4) NOT NULL,
  `birthday` date DEFAULT NULL,
  `identity_number` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL,
  `nation` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL,
  `native_place` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `living_place` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `marriage` tinyint(4) NOT NULL,
  `mobile` bigint(20) NOT NULL,
  `political_affiliation` tinyint(4) NOT NULL,
  `party` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `class_num` varchar(10) COLLATE utf8mb4_bin DEFAULT NULL,
  `stu_type` varchar(10) COLLATE utf8mb4_bin NOT NULL,
  `major` varchar(32) COLLATE utf8mb4_bin NOT NULL,
  `college` varchar(32) COLLATE utf8mb4_bin NOT NULL,
  `t_of_enrollment` date NOT NULL,
  `t_of_graduation` date NOT NULL,
  `source_of_student_type` varchar(32) COLLATE utf8mb4_bin DEFAULT NULL,
  `parents` json DEFAULT NULL,
  PRIMARY KEY (`stu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Records of student
-- ----------------------------
BEGIN;
INSERT INTO `student` VALUES (21210000, '张一', 1, '2000-01-01', '123123200001010010', '汉族', '江西', '江西', 0, 13921210001, 1, '无', '2101', '本科生', '通信', '电信学院', '2020-09-01', '2024-07-01', '统招本科', NULL);
INSERT INTO `student` VALUES (21210001, '张梓', 1, '2000-01-01', '123123200001010010', '汉族', '江西', '江西', 0, 13921210001, 1, '无', '2101', '本科生', '通信工程', '电信学院', '2020-09-01', '2024-07-01', '统招本科', NULL);
INSERT INTO `student` VALUES (21210002, '郭梦', 1, '1999-11-26', '370103199911260010', '汉族', '山东', '山东', 0, 13921210001, 1, '无', '2101', '本科生', '通信工程', '电信学院', '2020-09-01', '2024-07-01', '统招本科', NULL);
INSERT INTO `student` VALUES (21210003, '李枫', 1, '2001-02-14', '110000200102140010', '汉族', '北京', '北京', 0, 13921210001, 1, '无', '2101', '本科生', '通信工程', '电信学院', '2020-09-01', '2024-07-01', '统招本科', NULL);
INSERT INTO `student` VALUES (21210004, '赵四', 1, '2000-12-24', '310000200012240010', '汉族', '上海', '上海', 0, 13921210001, 1, '无', '2102', '本科生', '通信工程', '电信学院', '2020-09-01', '2024-07-01', '统招本科', NULL);
INSERT INTO `student` VALUES (21210005, '黄宇', 1, '2001-01-06', '370103200101060010', '汉族', '山东', '山东', 0, 13921210001, 1, '无', '2102', '本科生', '通信工程', '电信学院', '2020-09-01', '2024-07-01', '统招本科', NULL);
COMMIT;

-- ----------------------------
-- Table structure for study
-- ----------------------------
DROP TABLE IF EXISTS `study`;
CREATE TABLE `study` (
  `stu_id` int(11) NOT NULL,
  `scientific_payoff` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL,
  `type_of_payoff` tinyint(4) DEFAULT NULL COMMENT '0论文/1著作/2专利/3软著',
  `award_time` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL,
  KEY `stu_id` (`stu_id`),
  CONSTRAINT `study_ibfk_1` FOREIGN KEY (`stu_id`) REFERENCES `student` (`stu_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Records of study
-- ----------------------------
BEGIN;
INSERT INTO `study` VALUES (21210000, '发表《区块链应用于技术研究》于计算机工程期刊', 0, '2021-05-11');
INSERT INTO `study` VALUES (21210001, '编著《web应用于大学生实践》书籍', 1, '2021-04-12');
INSERT INTO `study` VALUES (21210000, '发表《数据库自动扩缩容》专利', 2, '2020-04-11');
INSERT INTO `study` VALUES (21210000, '软件著作《学生画像系统》', 3, '2021-02-03');
COMMIT;

-- ----------------------------
-- Table structure for zhu_xue_dai
-- ----------------------------
DROP TABLE IF EXISTS `zhu_xue_dai`;
CREATE TABLE `zhu_xue_dai` (
  `stu_id` int(11) NOT NULL,
  KEY `stu_id` (`stu_id`),
  CONSTRAINT `zhu_xue_dai_ibfk_1` FOREIGN KEY (`stu_id`) REFERENCES `student` (`stu_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Records of zhu_xue_dai
-- ----------------------------
BEGIN;
INSERT INTO `zhu_xue_dai` VALUES (21210001);
INSERT INTO `zhu_xue_dai` VALUES (21210002);
INSERT INTO `zhu_xue_dai` VALUES (21210005);
COMMIT;

-- ----------------------------
-- Table structure for zhu_xue_jin
-- ----------------------------
DROP TABLE IF EXISTS `zhu_xue_jin`;
CREATE TABLE `zhu_xue_jin` (
  `stu_id` int(11) NOT NULL,
  `name_of_zhu` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL,
  `grade_of_zhu` tinyint(4) DEFAULT NULL,
  `amount_of_zhu` int(11) DEFAULT NULL,
  `award_time` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL,
  KEY `stu_id` (`stu_id`),
  CONSTRAINT `zhu_xue_jin_ibfk_1` FOREIGN KEY (`stu_id`) REFERENCES `student` (`stu_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Records of zhu_xue_jin
-- ----------------------------
BEGIN;
INSERT INTO `zhu_xue_jin` VALUES (21210000, '阳光助学金', 1, 2000, '2021-02-20');
INSERT INTO `zhu_xue_jin` VALUES (21210000, '学院助学金', 2, 1200, '2021-09-07');
INSERT INTO `zhu_xue_jin` VALUES (21210001, '国家级贫困生助学金', 1, 3000, '2021-08-09');
INSERT INTO `zhu_xue_jin` VALUES (21210000, '国家级贫困生助学金', 1, 3000, '2021-08-09');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
